/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.db;

/**
 * <p>Project: javaseapp - Demo
 * <p>Powered by webrx On 2021-08-05 17:27:39
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Demo {
    public static void main(String[] args) {
        //java程序中不允许new 接口
        //Stu stu = new Stu() { };

        //此没有内部匿名类  推荐使用
        //Stu stu = (i) -> i * i;
        //System.out.println(stu.pf(3));

        //不使用lambda表达会产生内部匿名类 Demo$1.class
        Stu stu = i -> i * i;
        System.out.println(stu.pf(4));


    }
}


interface Stu {
    int pf(int i);

    default int lf(int i) {

        return i * i * i;
    }
}

/* MyUser 外部类，UserA UserB 内部类*/
class MyUser {
    /*可以使用*/
    private class UserA {
    }

    class UserB {
    }
}

